<?php
class Poll_Form_Search extends Engine_Form
{
    public function init() {
        $this->setAttribs(array(
                'id' => 'filter_form',
                'class' => 'global_form_box',
            ))
        ->setAction(Zend_Controller_Front::getInstance()->getRouter()->assemble(array()));

        parent::init();

        $this->addElement('Text', 'search', array(
            'label' => 'Search Questions:'
        ));

        $this->addElement('Select', 'privacy', array(
            'label' => 'Browse By:',
            'multiOptions' => array(
                'all' => 'All questions',
                'public' => 'Public questions',
                'friends' => 'Friends questions'
            ),
            'value' => 'all'
        ));
        
        $this->addElement('Select', 'order', array(
            'label' => 'Sort By:',
            'multiOptions' => array( 
                'total_votes DESC' => 'Popular questions',
                'poll_id DESC' => 'Latest questions'
            ),
            'value' => 'poll_id DESC'
        ));
        
        $this->addElement('Button', 'submit', array(
            'type' => 'submit',
            'label' => 'Search',
            'ignore' => true
        ));
    }
}